// webpack.config.js
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

module.exports = {
  configureWebpack: (config) => {
    config.plugins.push(
      AutoImport({
        resolvers: [ElementPlusResolver()]
      })
    )
    config.plugins.push(
      Components({
        resolvers: [ElementPlusResolver()]
      })
    )
  }
  // 解决跨域代理
  // devServer: {
  //   proxy: {
  //     '/api': {
  //       target: 'http://192.168.1.222:8000/api',
  //       changeOrigin: true,
  //       pathRewrite: {
  //         '^/api': ''// 重写路径
  //       }
  //     }
  //   }
  // }
}
